package ev.traffic;
import ev.agent.*;
import java.util.List;
import java.util.ArrayList;
public class Nodes{
	private int nodeNum;
	private Substation substation = null;
	private int xPos,yPos;
	private List<Car> carList;
	public Nodes(int nodeNum,int xPos,int yPos){
		this.nodeNum = nodeNum;
		this.xPos = xPos;
		this.yPos = yPos;
		carList = new ArrayList<Car>();
	}
	public int getXpos(){
		return this.xPos;
	}
	public int getYpos(){
		return this.yPos;
	}
	public int getNum(){
		return this.nodeNum;
	}
	public void addCar(Car car){
		this.carList.add(car);
	}
	public List<Car> getCarList(){
		return this.carList;
	}
	public Substation getSub(){
		return this.substation;
	}
	public void setSub(Substation substation){
		this.substation = substation; 
	}
	public boolean equals(Object obj){
		Nodes nodes = (Nodes)obj;
		if(this.nodeNum == nodes.getNum())
				return true;
		else return false;
	}
}
